<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h3>props</h3>
      <!-- 自定义属性要使用连字符, h5不区分大小写 -->
      <!-- props接受的时候用小驼峰 -->
      <!-- <child count-num="10"></child> -->

      <child
        name="junjun"
        :age="22"
        :weight="120"
        :likes="['298', '398', '698']"
      ></child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      const Child = {
        // props: ["name", "age", "weight", "likes"],
        // props可以使用对象的方式来接受, 允许我们去规定数据类型
        props: {
          name: String,
          age: Number,
          weight: Number,
          likes: Array,
        },
        template: `
          <div>
            {{name}}的年龄是{{age}},体重是{{weight}},爱好是{{likes}}
          </div>
        `,
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
